#ifndef _MEASPROG_H
#define _MEASPROG_H

#include "aprcfg.h"
#include <QString>
#include <QStringList>

class MeasProg
{
public:
	MeasProg();
	static MeasProg* getInstance();

	QString getProgFilePath() const { return progFilePath; }

	void saveProgToFile(const QString &path);
	void saveProgramToFile();
	void readProgFromFile(const QString &path);

	int getProgItemCount() const { /*return program.item_no;*/ return program.item_total; }
	void setProgItemCount(int no) { /*program.item_no = no;*/ program.item_total = no; }
	void setMeasType(meas_type_enum type) { program.meastype = type; }

	program_s *getProgPtr() { return &program; }

	bool setItem(ushort			index,
				 const QString 	&name,
 				 const QString 	&channel,
				 const QString 	&waitTime,
				 const QString 	&biasRange,
				 const QString 	&biasValue,
				 const QString 	&measRange,
				 const QString 	&measUpper,
				 const QString 	&measLower,
				 const QString 	&volLimit,
				 const QString 	&filOption,
				 const QString 	&limitJudge,
				 const QString 	&active,
				 const det_u*	det);

	bool getItem(ushort		index,
				 QString 	&name, 
				 QString 	&channel, 
				 QString 	&watiTime,
				 QString 	&biasRange,
				 QString 	&biasValue,
				 QString 	&measRange,
				 QString 	&measUpper,
				 QString 	&measLower,
				 QString 	&volLimit,
				 QString 	&filOption,
				 QString 	&limitJudge,
				 QString 	&active,
				 det_u*		det);

	int getMeasMode();
	
private:

//	void readIniFile();
	static MeasProg* instance;

	program_s 	program;
	setting_s	setting;
	QString		progFilePath;
};


#endif // _MEASPROG_H
